package core;

import java.util.ArrayList;
import java.util.List;

public class Node {
    private List<Node> childrens;
    private int node_data;
    private static int nb_nodes = 0;
    
    /**
	 * @return the childrens
	 */
	public List<Node> getChildrens() {
		return childrens;
	}


	/**
	 * @return the node_data
	 */
	public final int getNode_data() {
		return node_data;
	}

	/**
	 * @return the nb_nodes
	 */
	public static int get_nb_nodes() {
		return nb_nodes;
	}

	public Node(int nb_elements_per_node, int level, int max_level) {
    	this.node_data = nb_nodes;
    	nb_nodes++;
    	if (level < max_level)
    	{
	    	childrens = new ArrayList<Node>();
	    	for (int i = 0 ; i < nb_elements_per_node ; i++)
	    	{
	    		childrens.add(new Node(nb_elements_per_node, level+1, max_level));
	    	}
    	}
    	else
    	{
    		childrens = null;
    	}
    }
}